home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
EnigmA Amiga Run 1996 April
/
EnigmA AMIGA RUN 06 (1996)(G.R. Edizioni)(IT)[!][issue 1996-04][Skylink CD V].iso
/
progs
/
editor
/
write-ed
/
rexx
/
autosave.wrx
< prev
next >
Wrap
Text File
|
1995-05-01
|
1KB
|
68 lines
/*
* Autosave Script for WRITE
*
* Checks the environment variable "WRITE.Autosave" and takes its value
* in minutes between two saves. If the variable could not be found, it
* pops up a requester and asks for the autosave interval.
*
* Just run it {@ASYNC} from a write window.
*
* written 1994 by Lars Hanke, MGR-Asgard
*
*/
IF ~show('P',"WRITE") then
do
say "This script is for the WRITE editor. Please start it first."
exit 10
end
ADDRESS 'WRITE'
OPTIONS RESULTS
'VERSIONCHECK 40000 "AutoSave.wrx"'
IF RC~=0 THEN DO
exit 10
END
'GetVar (_CurrentID)'
ID = RESULT
'LockWindow' ID
IF Open(File,"ENV:WRITE.Autosave") THEN
do
SAVEDELAY = ReadLn(File);
call Close(File);
end
else do
'GetNumber (Minutes of Autosave delay) 5 {@TOMOUSE}'
'GetVar (_RN)'
SAVEDELAY = RESULT
if SAVEDELAY <= 0 then SAVEDELAY = 5
end
'LockWindow 0'
AUTOSAVE = SAVEDELAY * 60
do forever
ADDRESS 'COMMAND'
"WAIT" AUTOSAVE
ADDRESS 'WRITE'
'LockWindow' ID
'GetVar (_CurrentID)'
IF RESULT ~= ID THEN
do
'LockWindow 0'
exit 0
end
'GetVar (_Changed)'
IF RESULT ~= 0 then 'Save _FileName'
'LockWindow 0'
end